﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using YAPL.Language.Ast;
using YAPL.Util;
namespace YAPL.Language.SourceParser.XML.NodeParsers {
	public class XmlCodeBlockParser : XmlExpressionParser {
		public XmlCodeBlockParser(XmlInputParser inputParser) : base(inputParser) {}
		public override Expression ParseNode(XElement node) {
			var expressions = new List<Expression>();
			var expressionNodes = node.Elements();
			expressionNodes.Each(element => expressions.Add(Parser.ParseNode(element)));
			return Expressions.CodeBlock(expressions);
		}
	}
}
